Skip to content

SAS7BDAT parser: Speed up blank_missing #48502

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 13, 2022

Conversation

jonashaag
Copy link
Contributor

@jonashaag jonashaag commented Sep 10, 2022

Move blank_missing to Cython.

ASV:

# Old
io.sas.SAS.time_read_sas7bdat		10.6±0.05ms

# New
io.sas.SAS.time_read_sas7bdat		5.47±0.02ms
  • closes #xxxx (Replace xxxx with the Github issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@@ -9,6 +9,8 @@ ctypedef signed long long int64_t
ctypedef unsigned char uint8_t
ctypedef unsigned short uint16_t

cdef object np_nan = np.nan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needed? (np.nan is just used below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, it was meant to be used (the np.nan lookup is quite slow)

@mroeschke mroeschke added Performance Memory or execution speed performance IO SAS SAS: read_sas labels Sep 12, 2022
@mroeschke mroeschke added this to the 1.6 milestone Sep 13, 2022
@mroeschke mroeschke merged commit 8f21b97 into pandas-dev:main Sep 13, 2022
@mroeschke
Copy link
Member

Thanks @jonashaag

@mroeschke mroeschke modified the milestones: 1.6, 2.0 Oct 13, 2022
noatamir pushed a commit to noatamir/pandas that referenced this pull request Nov 9, 2022
* SAS7BDAT parser: Speed up blank_missing

* Add what's new

* Fix issue no

* Update v1.6.0.rst

* Update sas.pyx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO SAS SAS: read_sas Performance Memory or execution speed performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants